package com.sk.cardeal.entity;

import android.os.Parcel;
import android.os.Parcelable;

/**
 * Created by sk on 2018/1/15.
 */

public class Project implements Parcelable {

    /**
     * id : fec49d9089524d75afcb67121ef129fa
     * projectName : 补2222漆
     * manHoursPrice : 10.0
     * totalPrice : 40.0
     * couponPrice : 5.0
     * afterCutPrice : 35.0
     * manHours : 4.0
     * groupId : 402880eb60d8b87a0160d8bb2c450001
     * isdel : null
     * sorts : 0
     * createTime : 2018-01-12 10:50:27
     * updateTime : null
     * type : null
     */

    private String id;
    private String projectName;
    private double manHoursPrice;
    private double totalPrice;
    private double couponPrice;
    private double afterCutPrice;
    private double manHours;
    private String groupId;
    private String isdel;
    private int sorts;
    private String createTime;
    private String updateTime;
    private String type;
    private boolean isSelect = false;
    private double editPrice;
    private boolean isOpen = false;

    public boolean isOpen() {
        return isOpen;
    }

    public void setOpen(boolean open) {
        isOpen = open;
    }

    public double getEditPrice() {
        return editPrice;
    }

    public void setEditPrice(double editPrice) {
        this.editPrice = editPrice;
    }

    public boolean isSelect() {
        return isSelect;
    }

    public void setSelect(boolean select) {
        isSelect = select;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getProjectName() {
        return projectName;
    }

    public void setProjectName(String projectName) {
        this.projectName = projectName;
    }

    public double getManHoursPrice() {
        return manHoursPrice;
    }

    public void setManHoursPrice(double manHoursPrice) {
        this.manHoursPrice = manHoursPrice;
    }

    public double getTotalPrice() {
        return totalPrice;
    }

    public void setTotalPrice(double totalPrice) {
        this.totalPrice = totalPrice;
    }

    public double getCouponPrice() {
        return couponPrice;
    }

    public void setCouponPrice(double couponPrice) {
        this.couponPrice = couponPrice;
    }

    public double getAfterCutPrice() {
        return afterCutPrice;
    }

    public void setAfterCutPrice(double afterCutPrice) {
        this.afterCutPrice = afterCutPrice;
    }

    public double getManHours() {
        return manHours;
    }

    public void setManHours(double manHours) {
        this.manHours = manHours;
    }

    public String getGroupId() {
        return groupId;
    }

    public void setGroupId(String groupId) {
        this.groupId = groupId;
    }

    public String getIsdel() {
        return isdel;
    }

    public void setIsdel(String isdel) {
        this.isdel = isdel;
    }

    public int getSorts() {
        return sorts;
    }

    public void setSorts(int sorts) {
        this.sorts = sorts;
    }

    public String getCreateTime() {
        return createTime;
    }

    public void setCreateTime(String createTime) {
        this.createTime = createTime;
    }

    public String getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(String updateTime) {
        this.updateTime = updateTime;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public Project() {
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeString(this.id);
        dest.writeString(this.projectName);
        dest.writeDouble(this.manHoursPrice);
        dest.writeDouble(this.totalPrice);
        dest.writeDouble(this.couponPrice);
        dest.writeDouble(this.afterCutPrice);
        dest.writeDouble(this.manHours);
        dest.writeString(this.groupId);
        dest.writeString(this.isdel);
        dest.writeInt(this.sorts);
        dest.writeString(this.createTime);
        dest.writeString(this.updateTime);
        dest.writeString(this.type);
        dest.writeByte(this.isSelect ? (byte) 1 : (byte) 0);
        dest.writeDouble(this.editPrice);
        dest.writeByte(this.isOpen ? (byte) 1 : (byte) 0);
    }

    protected Project(Parcel in) {
        this.id = in.readString();
        this.projectName = in.readString();
        this.manHoursPrice = in.readDouble();
        this.totalPrice = in.readDouble();
        this.couponPrice = in.readDouble();
        this.afterCutPrice = in.readDouble();
        this.manHours = in.readDouble();
        this.groupId = in.readString();
        this.isdel = in.readString();
        this.sorts = in.readInt();
        this.createTime = in.readString();
        this.updateTime = in.readString();
        this.type = in.readString();
        this.isSelect = in.readByte() != 0;
        this.editPrice = in.readDouble();
        this.isOpen = in.readByte() != 0;
    }

    public static final Creator<Project> CREATOR = new Creator<Project>() {
        @Override
        public Project createFromParcel(Parcel source) {
            return new Project(source);
        }

        @Override
        public Project[] newArray(int size) {
            return new Project[size];
        }
    };
}
